Fix declaration-after-statement warning when compiling in strict C90 mode. (#113)
authorBranko Čibej <brane@apache.org>
Thu, 21 Sep 2017 16:27:24 +0000 (18:27 +0200)
committerSteven G. Johnson <stevenj@mit.edu>
Thu, 21 Sep 2017 16:27:24 +0000 (12:27 -0400)
utf8proc.c

index c14bbe13fc1eeed5a9ac3f590eff4f2673fb0edc..6961e4b10d3a200b3bde35223631004d692e4b56 100644 (file)
@@ -284,9 +284,8 @@ static utf8proc_bool grapheme_break_simple(int lbc, int tbc) {
 
 static utf8proc_bool grapheme_break_extended(int lbc, int tbc, utf8proc_int32_t *state)
 {
-  int lbc_override = lbc;
-  if (state && *state != UTF8PROC_BOUNDCLASS_START)
-    lbc_override = *state;
+  int lbc_override = ((state && *state != UTF8PROC_BOUNDCLASS_START)
+                      ? *state : lbc);
   utf8proc_bool break_permitted = grapheme_break_simple(lbc_override, tbc);
   if (state) {
     // Special support for GB 12/13 made possible by GB999. After two RI